using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using HFK.DxFluentUI.HorizontalGrid;
using HFK.DxFluentUIGUITest.Dummy;
using HFK.DxFluentUIGUITest.Dummy.DataObjects;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid;

namespace HFK.DxFluentUIGUITest.HorizontalGridControl
{
  public partial class HorizontalGridControlTestForm : DevExpress.XtraEditors.XtraForm
  {
    public HorizontalGridControlTestForm()
    {
      InitializeComponent();

      HorizontalGridFullFeatured horizontalgrid = new HorizontalGridFullFeatured();

      GridControl control = horizontalgrid.Get;
      control.Dock = DockStyle.Fill;

      this.Controls.Add(control);

      List<SomeData> data = new List<SomeData>();
      data.Add(new SomeData() {
        IntValue = 1,
        Subdata = new SomeSubdata() { Submember = "S1" },
        SubdataList = new List<SomeSubdata>() { 
          new SomeSubdata() { Submember = "LS11_A_Very_Long_Text_To_Try_If_The_ColumnWidth_Does_Behave_AS_Expeceted" }, 
          new SomeSubdata() { Submember = "LS12_A_Very_Long_Text_To_Try_If_The_ColumnWidth_Does_Behave_AS_Expeceted" } },
        ComplexSubdataList = new List<SingleHopClass>(){ 
          new SingleHopClass(){ 
            StringValue = "LCS11_Another_Very_Long_text_To_Try_If_The_ColumnWidth_Does_Behave_AS_Expeceted", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT11"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL1T11"}}}},
          new SingleHopClass(){ 
            StringValue = "LCS12_Another_Very_Long_text_To_Try_If_The_ColumnWidth_Does_Behave_AS_Expeceted", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT12"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL1T12"}}}}
        }
      });
      data.Add(new SomeData() {
        IntValue = 2, 
        Subdata = new SomeSubdata() { Submember = "S2" },
        SubdataList = new List<SomeSubdata>() { 
          new SomeSubdata() { Submember = "LS21" }, 
          new SomeSubdata() { Submember = "LS22" } },
        ComplexSubdataList = new List<SingleHopClass>(){ 
          new SingleHopClass(){ 
            StringValue = "LCS21", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT21"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL2T11"}}}},
          new SingleHopClass(){ 
            StringValue = "LCS22", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT22"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL2T12"}}}}
        }
      });
      data.Add(new SomeData() {
        IntValue = 3,
        Subdata = new SomeSubdata() { Submember = "S3" },
        SubdataList = new List<SomeSubdata>() { 
          new SomeSubdata() { Submember = "LS31" }, 
          new SomeSubdata() { Submember = "LS32" } },
        ComplexSubdataList = new List<SingleHopClass>(){ 
          new SingleHopClass(){ 
            StringValue = "LCS31", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT31"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL3T11"}}}},
          new SingleHopClass(){ 
            StringValue = "LCS32", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT32"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL3T12"}}}}
        }
      });
      data.Add(new SomeData() {
        IntValue = 4,
        Subdata = new SomeSubdata() { Submember = "S4" },
        SubdataList = new List<SomeSubdata>() { 
          new SomeSubdata() { Submember = "LS41" }, 
          new SomeSubdata() { Submember = "LS42" } },
        ComplexSubdataList = new List<SingleHopClass>(){ 
          new SingleHopClass(){ 
            StringValue = "LCS41", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT41"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL4T11"}}}},
          new SingleHopClass(){ 
            StringValue = "LCS42", 
            DhcProperty = new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LCT42"}},
            DhcList = new List<DualHopClass>(){new DualHopClass(){ ThcProperty = new TripleHopClass(){ StringProperty = "LL4T12"}}}}
        }
      });

      control.DataSource = data;
    }
  }
}